//
//  LanguageArrayController.h
//  Words2
//
//  Created by Mathieu Tozer on 11/09/06.
//  Copyright 2006 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#import "WordArrayController.h"
@class LanguageMO;



@interface LanguageArrayController : NSArrayController {
	IBOutlet NSTableView *tableView;
	IBOutlet NSTableView *supportedLangTableView;
	IBOutlet WordArrayController* wordController;
	IBOutlet NSTextField *languageName;
	IBOutlet NSTextField *firstLanguageInfoString;
	IBOutlet NSTextField *capabilitiesString;
	IBOutlet NSTableColumn *supportedLangTableViewColumn;
	IBOutlet NSArrayController *supportedLanguagesArrayController;
	IBOutlet NSArrayController *languageArrayController;

	NSMutableDictionary *availLangs;
	NSMutableDictionary *nativeLangs;
	NSMutableDictionary *keyLangDict;
	NSMutableDictionary *languageTranslatorDict;
	IBOutlet NSComboBox *nativeLanguagePopUp;
	int currentIndexCount;
	

}


-(NSArray *)arrayOfSupportedLanguageCapabilities;
-(IBAction)addObjectFromListOfSupportedLanguages:(id)sender;
-(void)createDefaultGroupsForLanguage:(LanguageMO*)language;
-(void)addDefaultWordsToLanguage:(LanguageMO*)language;
-(void)setUpDefaultDictionariesForLanguage:(LanguageMO*)lang;
-(IBAction)cancelAddNewLanguage:(id)sender;


// table view drag and drop support
- (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op;
- (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info row:(int)row dropOperation:(NSTableViewDropOperation)operation;

- (NSSortDescriptor *)sortDescriptor;

#pragma mark Import / Export Languages
- (IBAction)exportLanguage:(id)sender;
- (IBAction)importLanguage:(id)sender;
-(void)didEnd:(NSSavePanel *)sheet
   returnCode:(int)code
  contextInfo:(void *)contextInfo;

//used to provide info to the add languages view

-(IBAction)setNativeLanguage:(id)sender;
-(NSArray *)supportedLanguages;
-(NSArray *)nativeLanguages;
-(NSNumber *)defsCounts;

@end
